using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AudioRoot
{
    private static Dictionary<string, AudioClip> audioClipMap;

    public Dictionary<string, AudioClip> AudioClipMap
    {
        get => audioClipMap;
        set => audioClipMap = value;
    }

    private static string audioPath = "Audio/";
    private static string bgmPath = audioPath + "BGM/";
    private static string effectPath = audioPath + "Effect/";

    public string[] bgm = {"Elecrystal Sound Team"};
    public string[] effect =
    {
        "Award/award_01",
        "Bullet/bubble_01",
        "Bullet/bubble_02",
        "Bullet/bubble_03",
        "Bullet/bullet_01",
        "Bullet/bullet_02",
        "Click/click_01",
        "Click/click_02",
        "Click/click_03",
        "Click/click_04",
        "Close/close_01",
        "Get/get_01",
        "Gun/gun_01",
        "Gun/gun_02",
        "Gun/gun_03",
        "Gun/longgun_01",
        "Gun/shotgun_01",
        "Laser/laser_01",
        "Melee/knife-sword-swing",
        "Melee/sword-sound-1",
        "Melee/whip_01",
        "Melee/swing_01",
        "Melee/swing_02",
        "Melee/swing_03",
        "Melee/swing_04",
        "Melee/swing_05",
        "Open/open_01",
        "Other/heartBeat",
        "Tip/tip_01",
        "Victory/victory_01",
        "Wand/wand_01",
    };
    
    public AudioRoot()
    {
        audioClipMap = new Dictionary<string, AudioClip>();
        // foreach (var name in FileController.GetMusicFilesNameByRoot(Application.dataPath + "/Resources/" + bgmPath))
        // {
        //     audioClipMap.Add(name, (AudioClip)Resources.Load(bgmPath + name));
        // }
        foreach (var name in bgm)
        {
            audioClipMap.Add(name, (AudioClip)Resources.Load(bgmPath + name));
        }
        foreach (var name in effect)
        {
            audioClipMap.Add(name, Resources.Load<AudioClip>(effectPath + name));
        }
        // foreach (var name in FileController.GetMusicFilesNameByRoot(Application.dataPath + "/Resources/" + effectPath))
        // {
        //     audioClipMap.Add(name, Resources.Load<AudioClip>(effectPath + name));
        // }
    }
}